
apiVersion: v1
kind: Service
metadata:
    name: dms-iot-dm2-svc
    namespace: spark-cluster
spec:
    type: NodePort
    ports:
        - port: 8080
          targetPort: 8080
          nodePort: 30488
          name: tomcat-web
        - port: 22
          targetPort: 22
          name: tomcat-ssh
    selector:
        web: iotdm2


---
apiVersion: v1
kind: ReplicationController
metadata:
    name: dms-iot-dm2
    namespace: spark-cluster
spec:
    replicas: 1
    template:
        metadata:
            labels:
                web: iotdm2
        spec:
            containers:
            - image: index.tenxcloud.com/zhangshun/tomcat:7.0.72
              name: tomcat
              env:
                - name: RTA_CONFIG
                  value: /gluster/localconfig.conf
              volumeMounts:
              - mountPath: /tomcat/webapps
                name: iotdm2
              ports:
              - containerPort: 8080
                name: tomcat-web
              - containerPort: 22
                name: tomcat-ssh

            volumes:
            - name: iotdm2
              glusterfs:
                  endpoints: glusterfs-cluster
                  path: {{ gluster_dms_iot_dm2_volname }}
                  readOnly: false
